﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model Domain.SYS_DEPARTMENT
<style type="text/css">.gray-bg {background-color: white;}</style>
@using (Ajax.BeginForm("Save", null, new AjaxOptions()
                           {
                               HttpMethod = "Post",
                               OnBegin = "SubAjax.Loading",
                               OnComplete = "SubAjax.Complate",
                               OnFailure = "SubAjax.Failure",
                               OnSuccess = "SubAjax.Success"
                           },
                               new { @class = "form-horizontal dig-from", @role = "form" }))
{
    @Html.HiddenFor(p => p.ID)
    <div class="wrapper wrapper-content animated fadeInUp">
        <div class="row">
            <div class="ibox-detail-title">
                <i class="fa fa-pencil-square-o"></i>添加/修改部门
            </div>
            <div class="ibox-content">
                <div class="form-group">
                    <label class="col-xs-2 control-label">上级部门：</label>
                    <div class="col-xs-10">
                        <select id="PARENTID" name="PARENTID" class="form-control inline select2">
                            <option value="" @(Model.PARENTID == "" ? "selected" : "")>一级部门</option>
                            @{
                                foreach (var item in ViewBag.moduleparent)
                                {
                                    <option value="@item.id" @(Model.PARENTID == @item.id ? "selected" : "")>@WebPages.CommonHtmlHelper.RtfTextToHtml(item.name)</option>
                                }
                            }
                        </select>

                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-xs-2 control-label">部门名称：</label>
                    <div class="col-xs-10">
                        @Html.TextBoxFor(p => p.NAME, new { @class = "form-control", @placeholder = "请输入部门名称", @datatype = "*", @nullmsg = "请输入部门名称！", @errormsg = "请输入部门名称！" })
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-xs-2 control-label">部门排序：</label>
                    <div class="col-xs-10">
                        @Html.TextBoxFor(p => p.SHOWORDER, new { @class = "form-control", @id = "modulepath", @placeholder = "请输入部门排序值，正序排列", @datatype = "n", @nullmsg = "请输入部门排序值，正序排列", @errormsg = "只能输入数字" })
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="text-center">
                    <button class="btn btn-primary btn-save" type="submit"><i class="fa fa-check"></i> <span>确定保存</span></button>
                    <button class="btn btn-warning" id="btn-dig-close" type="button"><i class="fa fa-reply-all"></i> 取消返回</button>
                </div>
            </div>
        </div>
    </div>
}
@section scripts{
    <script type="text/javascript">$(function () {$('.form-horizontal').initValidform();});</script>
}
